css: Introduce dependencies for value computations
authorBenjamin Otte <otte@redhat.com>
Mon, 16 Jul 2012 12:48:43 +0000 (14:48 +0200)
committerBenjamin Otte <otte@redhat.com>
Tue, 28 Aug 2012 13:42:23 +0000 (15:42 +0200)
When values are computed, they might depend on various other values and
we need to track this so we can update the values when those other
values change. This is the first step in making that happen.

This patch does not do any dependency tracking at all, instead it uses
GTK_CSS_DEPENDS_ON_EVERYTHING as a sort of FIXME.

24 files changed:
gtk/gtkcssarrayvalue.c
gtk/gtkcssbgsizevalue.c
gtk/gtkcssbordervalue.c
gtk/gtkcsscomputedvalues.c
gtk/gtkcsscornervalue.c
gtk/gtkcsseasevalue.c
gtk/gtkcssenginevalue.c
gtk/gtkcssenumvalue.c
gtk/gtkcssimagelinear.c
gtk/gtkcssimagevalue.c
gtk/gtkcssinheritvalue.c
gtk/gtkcssinitialvalue.c
gtk/gtkcssnumbervalue.c
gtk/gtkcsspositionvalue.c
gtk/gtkcssrepeatvalue.c
gtk/gtkcssrgbavalue.c
gtk/gtkcssshadowsvalue.c
gtk/gtkcssshadowvalue.c
gtk/gtkcssstringvalue.c
gtk/gtkcsstypedvalue.c
gtk/gtkcsstypesprivate.h
gtk/gtkcssvalue.c
gtk/gtkcssvalueprivate.h
gtk/gtksymboliccolor.c

index a4fa0f4b62a961f704ee947f18850bf2534f2734..418ac655981ac7dee8af136d8a844100cbad3ae0 100644 (file)
@@ -41,9 +41,10 @@ gtk_css_value_array_free (GtkCssValue *value)
 }
 
 static GtkCssValue *
-gtk_css_value_array_compute (GtkCssValue     *value,
-                             guint            property_id,
-                             GtkStyleContext *context)
+gtk_css_value_array_compute (GtkCssValue        *value,
+                             guint               property_id,
+                             GtkStyleContext    *context,
+                             GtkCssDependencies *dependencies)
 {
   GtkCssValue *result;
   gboolean changed = FALSE;
@@ -52,10 +53,12 @@ gtk_css_value_array_compute (GtkCssValue     *value,
   if (value->n_values == 0)
     return _gtk_css_value_ref (value);
 
+  *dependencies = GTK_CSS_DEPENDS_ON_EVERYTHING;
+
   result = _gtk_css_array_value_new_from_array (value->values, value->n_values);
   for (i = 0; i < value->n_values; i++)
     {
-      result->values[i] = _gtk_css_value_compute (value->values[i], property_id, context);
+      result->values[i] = _gtk_css_value_compute (value->values[i], property_id, context, NULL);
       changed |= (result->values[i] != value->values[i]);
     }
 
index 38f605496e3d9b2b25b49b4bb1f8b3db7fe05650..2bff385b9f3ade956633afe7f8aa58d080bc3130 100644 (file)
@@ -41,15 +41,18 @@ gtk_css_value_bg_size_free (GtkCssValue *value)
 }
 
 GtkCssValue *
-gtk_css_value_bg_size_compute (GtkCssValue     *value,
-                               guint            property_id,
-                               GtkStyleContext *context)
+gtk_css_value_bg_size_compute (GtkCssValue        *value,
+                               guint               property_id,
+                               GtkStyleContext    *context,
+                               GtkCssDependencies *dependencies)
 {
   if (value->x == NULL && value->y == NULL)
     return _gtk_css_value_ref (value);
 
-  return _gtk_css_bg_size_value_new (value->x ? _gtk_css_value_compute (value->x, property_id, context) : NULL,
-                                     value->y ? _gtk_css_value_compute (value->y, property_id, context) : NULL);
+  *dependencies = GTK_CSS_DEPENDS_ON_EVERYTHING;
+
+  return _gtk_css_bg_size_value_new (value->x ? _gtk_css_value_compute (value->x, property_id, context, NULL) : NULL,
+                                     value->y ? _gtk_css_value_compute (value->y, property_id, context, NULL) : NULL);
 }
 
 static gboolean
index 45f7fd14e4a1aa7330af566b1b8de2723ce0aaf7..085e3f2e40efc980bc3b14963ccc6e6e2db5dd0f 100644 (file)
@@ -42,14 +42,17 @@ gtk_css_value_border_free (GtkCssValue *value)
 }
 
 static GtkCssValue *
-gtk_css_value_border_compute (GtkCssValue     *value,
-                              guint            property_id,
-                              GtkStyleContext *context)
+gtk_css_value_border_compute (GtkCssValue        *value,
+                              guint               property_id,
+                              GtkStyleContext    *context,
+                              GtkCssDependencies *dependencies)
 {
   GtkCssValue *computed;
   gboolean changed = FALSE;
   guint i;
 
+  *dependencies = GTK_CSS_DEPENDS_ON_EVERYTHING;
+
   computed = _gtk_css_border_value_new (NULL, NULL, NULL, NULL);
   computed->fill = value->fill;
 
@@ -57,7 +60,7 @@ gtk_css_value_border_compute (GtkCssValue     *value,
     {
       if (value->values[i])
         {
-          computed->values[i] = _gtk_css_value_compute (value->values[i], property_id, context);
+          computed->values[i] = _gtk_css_value_compute (value->values[i], property_id, context, NULL);
           changed |= (computed->values[i] != value->values[i]);
         }
     }
index 7aa121f0237ff4462e9c3e1eb64b23116262261c..ad0353046d700abd38efaeb09996b675da22af9e 100644 (file)
@@ -113,7 +113,7 @@ _gtk_css_computed_values_compute_value (GtkCssComputedValues *values,
   else
     _gtk_css_value_ref (specified);
 
-  g_ptr_array_index (values->values, id) = _gtk_css_value_compute (specified, id, context);
+  g_ptr_array_index (values->values, id) = _gtk_css_value_compute (specified, id, context, NULL);
 
   if (section)
     {
index 7e41688950e71500e625a228c1af2aed41f62bac..8710243aff3bc2fc2b794eb0410cbaf52370e7ca 100644 (file)
@@ -37,14 +37,17 @@ gtk_css_value_corner_free (GtkCssValue *value)
 }
 
 static GtkCssValue *
-gtk_css_value_corner_compute (GtkCssValue     *corner,
-                              guint            property_id,
-                              GtkStyleContext *context)
+gtk_css_value_corner_compute (GtkCssValue        *corner,
+                              guint               property_id,
+                              GtkStyleContext    *context,
+                              GtkCssDependencies *dependencies)
 {
   GtkCssValue *x, *y;
 
-  x = _gtk_css_value_compute (corner->x, property_id, context);
-  y = _gtk_css_value_compute (corner->y, property_id, context);
+  *dependencies = GTK_CSS_DEPENDS_ON_EVERYTHING;
+
+  x = _gtk_css_value_compute (corner->x, property_id, context, NULL);
+  y = _gtk_css_value_compute (corner->y, property_id, context, NULL);
   if (x == corner->x && y == corner->y)
     {
       _gtk_css_value_unref (x);
index 122d6c129965cf999285ee791bfe3be8b40b5017..81c9bce56a8b50be31699588f3a69dc13ac54c7b 100644 (file)
@@ -50,9 +50,10 @@ gtk_css_value_ease_free (GtkCssValue *value)
 }
 
 static GtkCssValue *
-gtk_css_value_ease_compute (GtkCssValue     *value,
-                            guint            property_id,
-                            GtkStyleContext *context)
+gtk_css_value_ease_compute (GtkCssValue        *value,
+                            guint               property_id,
+                            GtkStyleContext    *context,
+                            GtkCssDependencies *dependencies)
 {
   return _gtk_css_value_ref (value);
 }
index 8041090a09c786b1629e44b98d599cf20356c36a..a39ac6c57d70503eb59965eb2bddea02a9d9bc49 100644 (file)
@@ -35,9 +35,10 @@ gtk_css_value_engine_free (GtkCssValue *value)
 }
 
 static GtkCssValue *
-gtk_css_value_engine_compute (GtkCssValue     *value,
-                              guint            property_id,
-                              GtkStyleContext *context)
+gtk_css_value_engine_compute (GtkCssValue        *value,
+                              guint               property_id,
+                              GtkStyleContext    *context,
+                              GtkCssDependencies *dependencies)
 {
   return _gtk_css_value_ref (value);
 }
index fb9c836388e967ec8f4714e24c6b321f417fe107..9ea7ae8f017b82b2bb8f4030789dce6095789dcd 100644 (file)
@@ -36,9 +36,10 @@ gtk_css_value_enum_free (GtkCssValue *value)
 }
 
 static GtkCssValue *
-gtk_css_value_enum_compute (GtkCssValue     *value,
-                            guint            property_id,
-                            GtkStyleContext *context)
+gtk_css_value_enum_compute (GtkCssValue        *value,
+                            guint               property_id,
+                            GtkStyleContext    *context,
+                            GtkCssDependencies *dependencies)
 {
   return _gtk_css_value_ref (value);
 }
index 10977e8ff21a6b2e9ef8b37fb8f5792d9d25093e..998d3660cf0732267a55744ccc814902baaf70ff 100644 (file)
@@ -420,7 +420,7 @@ gtk_css_image_linear_compute (GtkCssImage     *image,
   copy = g_object_new (GTK_TYPE_CSS_IMAGE_LINEAR, NULL);
   copy->repeating = linear->repeating;
 
-  copy->angle = _gtk_css_value_compute (linear->angle, property_id, context);
+  copy->angle = _gtk_css_value_compute (linear->angle, property_id, context, NULL);
   
   g_array_set_size (copy->stops, linear->stops->len);
   for (i = 0; i < linear->stops->len; i++)
@@ -430,10 +430,10 @@ gtk_css_image_linear_compute (GtkCssImage     *image,
       stop = &g_array_index (linear->stops, GtkCssImageLinearColorStop, i);
       scopy = &g_array_index (copy->stops, GtkCssImageLinearColorStop, i);
               
-      scopy->color = _gtk_css_value_compute (stop->color, property_id, context);
+      scopy->color = _gtk_css_value_compute (stop->color, property_id, context, NULL);
       
       if (stop->offset)
-        scopy->offset = _gtk_css_value_compute (stop->offset, property_id, context);
+        scopy->offset = _gtk_css_value_compute (stop->offset, property_id, context, NULL);
       else
         scopy->offset = NULL;
     }
index 5cd4929234ba4036645b1671b7d1cb81b2517f68..e56db9d476afc721639f39afefc8b21017af6a3f 100644 (file)
@@ -34,9 +34,10 @@ gtk_css_value_image_free (GtkCssValue *value)
 }
 
 static GtkCssValue *
-gtk_css_value_image_compute (GtkCssValue     *value,
-                             guint            property_id,
-                             GtkStyleContext *context)
+gtk_css_value_image_compute (GtkCssValue        *value,
+                             guint               property_id,
+                             GtkStyleContext    *context,
+                             GtkCssDependencies *dependencies)
 {
   GtkCssImage *image, *computed;
   
@@ -53,6 +54,8 @@ gtk_css_value_image_compute (GtkCssValue     *value,
       return _gtk_css_value_ref (value);
     }
 
+  *dependencies = GTK_CSS_DEPENDS_ON_EVERYTHING;
+
   return _gtk_css_image_value_new (computed);
 }
 
index 6faeef3c84a0867e835885c4e78309aaa65ac3db..58964be2409f6f8f45e6748524753de67d52a0a6 100644 (file)
@@ -34,18 +34,22 @@ gtk_css_value_inherit_free (GtkCssValue *value)
 }
 
 static GtkCssValue *
-gtk_css_value_inherit_compute (GtkCssValue     *value,
-                               guint            property_id,
-                               GtkStyleContext *context)
+gtk_css_value_inherit_compute (GtkCssValue        *value,
+                               guint               property_id,
+                               GtkStyleContext    *context,
+                               GtkCssDependencies *dependencies)
 {
   GtkStyleContext *parent = gtk_style_context_get_parent (context);
 
+  *dependencies = GTK_CSS_DEPENDS_ON_EVERYTHING;
+
   if (parent)
     return _gtk_css_value_ref (_gtk_style_context_peek_property (parent, property_id));
   else
     return _gtk_css_value_compute (_gtk_css_style_property_get_initial_value (_gtk_css_style_property_lookup_by_id (property_id)),
                                    property_id,
-                                   context);
+                                   context,
+                                   NULL);
 }
 
 static gboolean
index 7bebbc87d7a13342aa217348c55c29374a38b6d6..45cadd7c174bc4730436c20596f25ec8ca49fddc 100644 (file)
@@ -33,13 +33,15 @@ gtk_css_value_initial_free (GtkCssValue *value)
 }
 
 static GtkCssValue *
-gtk_css_value_initial_compute (GtkCssValue     *value,
-                               guint            property_id,
-                               GtkStyleContext *context)
+gtk_css_value_initial_compute (GtkCssValue        *value,
+                               guint               property_id,
+                               GtkStyleContext    *context,
+                               GtkCssDependencies *dependencies)
 {
   return _gtk_css_value_compute (_gtk_css_style_property_get_initial_value (_gtk_css_style_property_lookup_by_id (property_id)),
                                  property_id,
-                                 context);
+                                 context,
+                                 dependencies);
 }
 
 static gboolean
index 479662c22bab286c67b5d12c777161a18d1400eb..535c20587fa84fff2b2811252776ce5d779b135c 100644 (file)
@@ -35,9 +35,10 @@ gtk_css_value_number_free (GtkCssValue *value)
 }
 
 static GtkCssValue *
-gtk_css_value_number_compute (GtkCssValue     *number,
-                              guint            property_id,
-                              GtkStyleContext *context)
+gtk_css_value_number_compute (GtkCssValue        *number,
+                              guint               property_id,
+                              GtkStyleContext    *context,
+                              GtkCssDependencies *dependencies)
 {
   GtkBorderStyle border_style;
 
@@ -73,6 +74,8 @@ gtk_css_value_number_compute (GtkCssValue     *number,
         break;
     }
 
+  *dependencies = GTK_CSS_DEPENDS_ON_EVERYTHING;
+
   switch (number->unit)
     {
     default:
index 9f4b0d3f0ab6c062f039c36112c70b898cc5ccd5..6a6cbe3828d380037ae6d4276736045cb838d913 100644 (file)
@@ -37,14 +37,15 @@ gtk_css_value_position_free (GtkCssValue *value)
 }
 
 static GtkCssValue *
-gtk_css_value_position_compute (GtkCssValue     *position,
-                                guint            property_id,
-                                GtkStyleContext *context)
+gtk_css_value_position_compute (GtkCssValue        *position,
+                                guint               property_id,
+                                GtkStyleContext    *context,
+                                GtkCssDependencies *dependencies)
 {
   GtkCssValue *x, *y;
 
-  x = _gtk_css_value_compute (position->x, property_id, context);
-  y = _gtk_css_value_compute (position->y, property_id, context);
+  x = _gtk_css_value_compute (position->x, property_id, context, NULL);
+  y = _gtk_css_value_compute (position->y, property_id, context, NULL);
   if (x == position->x && y == position->y)
     {
       _gtk_css_value_unref (x);
@@ -52,6 +53,8 @@ gtk_css_value_position_compute (GtkCssValue     *position,
       return _gtk_css_value_ref (position);
     }
 
+  *dependencies = GTK_CSS_DEPENDS_ON_EVERYTHING;
+
   return _gtk_css_position_value_new (x, y);
 }
 
index 97fe41f349a746c740c1e7f60516f709878251d1..6f070727e84500a47d6b8531bfdf06d796ec5ad8 100644 (file)
@@ -34,9 +34,10 @@ gtk_css_value_repeat_free (GtkCssValue *value)
 }
 
 static GtkCssValue *
-gtk_css_value_repeat_compute (GtkCssValue     *value,
-                              guint            property_id,
-                              GtkStyleContext *context)
+gtk_css_value_repeat_compute (GtkCssValue        *value,
+                              guint               property_id,
+                              GtkStyleContext    *context,
+                              GtkCssDependencies *dependencies)
 {
   return _gtk_css_value_ref (value);
 }
index 7a641a3a7764c02837538f8e06809e4c2f83322a..3bb6897d135055145592f475b8a1de2a60592330 100644 (file)
@@ -35,9 +35,10 @@ gtk_css_value_rgba_free (GtkCssValue *value)
 }
 
 static GtkCssValue *
-gtk_css_value_rgba_compute (GtkCssValue     *value,
-                            guint            property_id,
-                            GtkStyleContext *context)
+gtk_css_value_rgba_compute (GtkCssValue        *value,
+                            guint               property_id,
+                            GtkStyleContext    *context,
+                            GtkCssDependencies *dependencies)
 {
   return _gtk_css_value_ref (value);
 }
index 387076eb38492cef7bbff4b5d1dd78770058c52f..ce37d86b4d8d411bbeeff24abaaf1c85455c2a51 100644 (file)
@@ -48,9 +48,10 @@ gtk_css_value_shadows_free (GtkCssValue *value)
 }
 
 static GtkCssValue *
-gtk_css_value_shadows_compute (GtkCssValue     *value,
-                               guint            property_id,
-                               GtkStyleContext *context)
+gtk_css_value_shadows_compute (GtkCssValue        *value,
+                               guint               property_id,
+                               GtkStyleContext    *context,
+                               GtkCssDependencies *dependencies)
 {
   GtkCssValue *result;
   guint i;
@@ -58,10 +59,12 @@ gtk_css_value_shadows_compute (GtkCssValue     *value,
   if (value->len == 0)
     return _gtk_css_value_ref (value);
 
+  *dependencies = GTK_CSS_DEPENDS_ON_EVERYTHING;
+
   result = gtk_css_shadows_value_new (value->values, value->len);
   for (i = 0; i < value->len; i++)
     {
-      result->values[i] = _gtk_css_value_compute (value->values[i], property_id, context);
+      result->values[i] = _gtk_css_value_compute (value->values[i], property_id, context, NULL);
     }
 
   return result;
index 3351d6f8dd11f7bba530529339e1449a842261df..9b2d897aea4ac00fc9a8e305ece90cda995eb11e 100644 (file)
@@ -60,16 +60,19 @@ gtk_css_value_shadow_free (GtkCssValue *shadow)
 }
 
 static GtkCssValue *
-gtk_css_value_shadow_compute (GtkCssValue     *shadow,
-                              guint            property_id,
-                              GtkStyleContext *context)
+gtk_css_value_shadow_compute (GtkCssValue        *shadow,
+                              guint               property_id,
+                              GtkStyleContext    *context,
+                              GtkCssDependencies *dependencies)
 {
-  return gtk_css_shadow_value_new (_gtk_css_value_compute (shadow->hoffset, property_id, context),
-                                   _gtk_css_value_compute (shadow->voffset, property_id, context),
-                                   _gtk_css_value_compute (shadow->radius, property_id, context),
-                                   _gtk_css_value_compute (shadow->spread, property_id, context),
+  *dependencies = GTK_CSS_DEPENDS_ON_EVERYTHING;
+
+  return gtk_css_shadow_value_new (_gtk_css_value_compute (shadow->hoffset, property_id, context, NULL),
+                                   _gtk_css_value_compute (shadow->voffset, property_id, context, NULL),
+                                   _gtk_css_value_compute (shadow->radius, property_id, context, NULL),
+                                   _gtk_css_value_compute (shadow->spread, property_id, context, NULL),
                                    shadow->inset,
-                                   _gtk_css_value_compute (shadow->color, property_id, context));
+                                   _gtk_css_value_compute (shadow->color, property_id, context, NULL));
 }
 
 static gboolean
index 2bc140dd97bc20a5e82bce14cee4f43ab2927709..328fd21dc58fdb0c023a2118d7da96d0c4ddd744 100644 (file)
@@ -33,9 +33,10 @@ gtk_css_value_string_free (GtkCssValue *value)
 }
 
 static GtkCssValue *
-gtk_css_value_string_compute (GtkCssValue     *value,
-                              guint            property_id,
-                              GtkStyleContext *context)
+gtk_css_value_string_compute (GtkCssValue        *value,
+                              guint               property_id,
+                              GtkStyleContext    *context,
+                              GtkCssDependencies *dependencies)
 {
   return _gtk_css_value_ref (value);
 }
index 60eeea8c6869a83a842cedc299eb767ca5670a02..fd8f0ad92556ec5e2de1d5d37d000b7226a34646 100644 (file)
@@ -35,12 +35,15 @@ gtk_css_value_typed_free (GtkCssValue *value)
 }
 
 static GtkCssValue *
-gtk_css_value_typed_compute (GtkCssValue     *value,
-                             guint            property_id,
-                             GtkStyleContext *context)
+gtk_css_value_typed_compute (GtkCssValue        *value,
+                             guint               property_id,
+                             GtkStyleContext    *context,
+                             GtkCssDependencies *dependencies)
 {
   GtkCssCustomProperty *custom = GTK_CSS_CUSTOM_PROPERTY (_gtk_css_style_property_lookup_by_id (property_id));
 
+  *dependencies = GTK_CSS_DEPENDS_ON_EVERYTHING;
+
   return _gtk_css_style_compute_value (context, custom->pspec->value_type, value);
 }
 
index b0db18d0b9bd4e384355a4c8e175c3692b642267..dfc9527e0db4f653484f54cac06192a8ffab8245 100644 (file)
@@ -56,6 +56,16 @@ typedef enum { /*< skip >*/
                                    GTK_CSS_CHANGE_PARENT_POSITION | GTK_CSS_CHANGE_PARENT_SIBLING_POSITION | \
                                    GTK_CSS_CHANGE_PARENT_STATE | GTK_CSS_CHANGE_PARENT_SIBLING_STATE)
 
+typedef enum /*< skip >*/ {
+  GTK_CSS_DEPENDS_ON_PARENT = (1 << 0),
+  GTK_CSS_EQUALS_PARENT = (1 << 1),
+  GTK_CSS_DEPENDS_ON_COLOR = (1 << 2),
+  GTK_CSS_DEPENDS_ON_FONT_SIZE = (1 << 3)
+} GtkCssDependencies;
+
+#define GTK_CSS_DEPENDS_ON_EVERYTHING (GTK_CSS_DEPENDS_ON_PARENT | GTK_CSS_EQUALS_PARENT \
+                                       | GTK_CSS_DEPENDS_ON_COLOR | GTK_CSS_DEPENDS_ON_FONT_SIZE)
+
 enum { /*< skip >*/
   GTK_CSS_PROPERTY_COLOR,
   GTK_CSS_PROPERTY_FONT_SIZE,
index 5d5d39227fdaff5ff457f8d91c11f180c4d44c9b..e057f90b50d4afab51d921080f4331521fa959d4 100644 (file)
@@ -66,6 +66,9 @@ _gtk_css_value_unref (GtkCssValue *value)
  * @value: the value to compute from
  * @property_id: the ID of the property to compute
  * @context: the context to use for resolving
+ * @dependencies: (out) (allow-none): Set to the dependencies of the
+ *     computed values that indicate when this value needs to be
+ *     recomputed and how.
  *
  * Converts the specified @value into the computed value for the CSS
  * property given by @property_id using the information in @context.
@@ -73,17 +76,24 @@ _gtk_css_value_unref (GtkCssValue *value)
  * <ulink url="http://www.w3.org/TR/css3-cascade/#computed>
  * the CSS documentation</ulink>.
  *
- * Returns: the comptued value
+ * Returns: the computed value
  **/
 GtkCssValue *
-_gtk_css_value_compute (GtkCssValue     *value,
-                        guint            property_id,
-                        GtkStyleContext *context)
+_gtk_css_value_compute (GtkCssValue        *value,
+                        guint               property_id,
+                        GtkStyleContext    *context,
+                        GtkCssDependencies *dependencies)
 {
+  GtkCssDependencies fallback;
+
   g_return_val_if_fail (value != NULL, NULL);
   g_return_val_if_fail (GTK_IS_STYLE_CONTEXT (context), NULL);
 
-  return value->class->compute (value, property_id, context);
+  if (dependencies == NULL)
+    dependencies = &fallback;
+  *dependencies = 0;
+
+  return value->class->compute (value, property_id, context, dependencies);
 }
 
 gboolean
index 74550f794e306ea92da038117bf0739e7b22eef1..629cc754b20f8d959122ad67dc07bc38ad12e0fb 100644 (file)
@@ -44,7 +44,8 @@ struct _GtkCssValueClass {
 
   GtkCssValue * (* compute)                           (GtkCssValue                *value,
                                                        guint                       property_id,
-                                                       GtkStyleContext            *context);
+                                                       GtkStyleContext            *context,
+                                                       GtkCssDependencies         *dependencies);
   gboolean      (* equal)                             (const GtkCssValue          *value1,
                                                        const GtkCssValue          *value2);
   GtkCssValue * (* transition)                        (GtkCssValue                *start,
@@ -65,7 +66,8 @@ void         _gtk_css_value_unref                     (GtkCssValue
 
 GtkCssValue *_gtk_css_value_compute                   (GtkCssValue                *value,
                                                        guint                       property_id,
-                                                       GtkStyleContext            *context);
+                                                       GtkStyleContext            *context,
+                                                       GtkCssDependencies         *dependencies);
 gboolean     _gtk_css_value_equal                     (const GtkCssValue          *value1,
                                                        const GtkCssValue          *value2);
 gboolean     _gtk_css_value_equal0                    (const GtkCssValue          *value1,
index 8429bbc67b6c9ec4fcfaf27c9db7b11a8becbbfe..9fcfd4957e1414909b7033135ffa7194762e1f1a 100644 (file)
@@ -142,7 +142,8 @@ gtk_css_value_symbolic_get_fallback (guint            property_id,
       case GTK_CSS_PROPERTY_OUTLINE_COLOR:
         return _gtk_css_value_compute (_gtk_css_style_property_get_initial_value (_gtk_css_style_property_lookup_by_id (property_id)),
                                        property_id,
-                                       context);
+                                       context,
+                                       NULL);
       default:
         if (property_id < GTK_CSS_PROPERTY_N_PROPERTIES)
           g_warning ("No fallback color defined for property '%s'", 
@@ -152,12 +153,15 @@ gtk_css_value_symbolic_get_fallback (guint            property_id,
 }
 
 static GtkCssValue *
-gtk_css_value_symbolic_compute (GtkCssValue     *value,
-                                guint            property_id,
-                                GtkStyleContext *context)
+gtk_css_value_symbolic_compute (GtkCssValue        *value,
+                                guint               property_id,
+                                GtkStyleContext    *context,
+                                GtkCssDependencies *dependencies)
 {
   GtkCssValue *resolved, *current;
 
+  *dependencies = GTK_CSS_DEPENDS_ON_EVERYTHING;
+
   /* The computed value of the ‘currentColor’ keyword is the computed
    * value of the ‘color’ property. If the ‘currentColor’ keyword is
    * set on the ‘color’ property itself, it is treated as ‘color: inherit’.